package com.ss.android.article.base.feature.detail.presenter;

import com.ss.android.article.base.feature.detail.model.ArticleDetail;
import com.ss.android.article.base.feature.model.Article;
import com.ss.android.common.load.AsyncLoader.LoaderProxy;

final class ArticleDetailCacheLoader implements LoaderProxy {
    private final DetailLoader mDetailLoader;

    ArticleDetailCacheLoader(DetailLoader detailLoader) {
        this.mDetailLoader = detailLoader;

    }

    public final Object doInBackground(Object key, Object param, Object extra) {
        return this.mDetailLoader.getArticleDetailWithCache(((Article) param), ((String) extra));
    }

    public final void onLoaded(Object key, Object param, Object extra, Object result) {
        DetailLoader.Callback callback = this.mDetailLoader.mDetailLoaderCallbackRef.get();
        if(callback != null) {
            callback.onArticleDetailLoadedWithCache(((Article) param), ((ArticleDetail) result));
        }
    }
}

